package com.dragon.shop_user.feign;

import com.dragon.shop_common.utils.AjaxResult;
import com.dragon.shop_user.domain.param.GetOrderNoParam;
import com.dragon.shop_user.domain.vo.GetOrderNoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "shop-order", path = "/order")
public interface OrderFeign {

    @GetMapping("/getOrderNo")
    AjaxResult<String> getOrderNo();

    @GetMapping("/getOrderNo2")
    AjaxResult<GetOrderNoVo> getOrderNo2(@RequestParam String userId);

    @GetMapping("/getOrderNo3")
    AjaxResult<GetOrderNoVo> getOrderNo3(@RequestParam String userId);

    @PostMapping(value = "/getOrderNo4", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    AjaxResult<GetOrderNoVo> getOrderNo4(GetOrderNoParam getOrderNoParam);

    @PostMapping("/getOrderNo5")
    public AjaxResult<GetOrderNoVo> getOrderNo5(@RequestBody GetOrderNoParam getOrderNoParam);

    // @GetMapping("order/getOrderNo")
    // String getOrderNo(@RequestParam String userId,@RequestParam String tenantId,@RequestHeader("Authorization") String token);

    // @GetMapping("order/getOrderNo")
    // String getOrderNo(@RequestParam String userId, @RequestParam String tenantId, @RequestHeader MultiValueMap<String, String> headers);

    @GetMapping("/createOrder")
    AjaxResult<String> createOrder(@RequestParam String userId);

}
